﻿using System;
using System.ServiceModel;
using System.Security.Permissions;
using Sinacor.Infra.Service.Security.Services;
using Sinacor.Infra.Service.ExceptionHandling;
using System.Collections.Generic;

namespace Sinacor.Service.Infra.AuthorizationService.Service.ServiceContract
{
    /// <summary>
    /// Contrato de servico IAuthorization
    /// </summary>
    [ExceptionShielding]
    [ServiceContract(Namespace = "http://www.bovespa.com.br/Sinacor.Service.Infra.AuthorizationService.Service.ServiceContract", Name = "IAuthorization", SessionMode = SessionMode.Allowed)]
    public interface IAuthorization
    {
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))] 
        /*[NOVOSATRIBUTOS]*/
        [OperationLog]
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, Action = "AuthorizeUser")]
        DataContract.User AuthorizeUser();

		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
		[FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))] 
        /*[NOVOSATRIBUTOS]*/
        [OperationLog]
		[OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, Action = "RetrieveUserRoles")]
		List<DataContract.Response.UserRolesResponse> RetrieveUserRoles(DataContract.Request.RetrieveUserRolesRequest request);

        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))]
        [OperationLog]
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, Action = "VerifyInstalledModuleId")]
        Boolean VerifyInstalledModuleId(String moduleId);
    }
}
